﻿using System;
using System.Windows.Forms;

namespace GDM.Hogar.Controles.Validador.Componentes
{
    /// <summary>
    /// Provider data for custom validation - CustomValidation event.
    /// </summary>
    public sealed class ValidationEventArgs : EventArgs
    {
        private readonly Control _control;

        /// <summary>
        /// Gets or Sets a value indicating whether control text pass custom code test.
        /// </summary>
        private bool _valid = true;

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="control">Validated control instance.</param>
        public ValidationEventArgs(Control control)
        {
            this._control = control;
        }

        /// <summary>
        /// Gets control which when raise CustomValidation event.
        /// </summary>
        public Control Control
        {
            get
            {
                return this._control;
            }
        }

        public bool Valid
        {
            get
            {
                return this._valid;
            }
            set
            {
                this._valid = value;
            }
        }
    }
}